<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        .container {
            width: 800px;
            background: green;

        }
        .container:after {
            /* 设置伪元素内容为空 */
            content: "";
            /* 清除浮动 */
            clear: both;
            /* 改成块元素 */
            display: block;
        }
        .box1,
        .box2,
        .box3,
        .box4,
        .box5,
        .box6 {
            width: 100px;
            height: 100px;
            float: left;
        }
        .box1 {
            background: red;
        }
        .box2 {
            background: orange;
        }
        .box3 {
            background: yellow;
        }
        .box4 {
            background: yellowgreen;
        }
        .box5 {
            background: turquoise;
        }
        .box6 {
            background: blue;
        }
        .box7 {
            background: pink;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="box1">box1-1-1</div>
        <div class="box2">box2-2-2</div>
        <div class="box3">box3-3-3</div>
        <div class="box4">box4-4-4</div>
        <div class="box5">box5-5-5</div>
        <div class="box6">box6-6-6</div>
    </div>
    <div class="box7">外侧盒子</div>
</body>
</html>